package com.hctforgreen.greenservice.model;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 获取开机备用密码
 * 
 * @author wuhs
 * 
 */
public class SpareBootPasswordEntity extends BaseEntity {

	private static final long serialVersionUID = 439712719693268736L;

	public String statusCode = "";
	public String msg = "";

	/**
	 * 开机密码状态
	 * 0：正常 其他：异常（待定）
	 */
	public String bootStatus = "";
	/**
	 * 返回信息
	 */
	public String bootMsg = "";
	/**
	 * 开机密码
	 */
	public String bootPwd = "";
	
	public final static String STATUS_CODE = "statusCode";
	public final static String MSG = "msg";

	public final static String BOOT_STATUS = "sparebootStatus";
	public final static String BOOT_MSG = "sparebootMsg";
	public final static String BOOT_PWD = "sparebootPwd";
	
	public static SpareBootPasswordEntity parse(JSONObject jsonObject)
			throws JSONException {
		SpareBootPasswordEntity bean = new SpareBootPasswordEntity();
		if (jsonObject.has(STATUS_CODE)) {
			bean.statusCode = jsonObject.getString(STATUS_CODE);
		}
		if (jsonObject.has(MSG)) {
			bean.msg = jsonObject.getString(MSG);
		}
		if (jsonObject.has(BOOT_STATUS)) {
			bean.bootStatus = jsonObject.getString(BOOT_STATUS);
		}
		if (jsonObject.has(BOOT_MSG)) {
			bean.bootMsg = jsonObject.getString(BOOT_MSG);
		}
		if (jsonObject.has(BOOT_PWD)) {
			bean.bootPwd = jsonObject.getString(BOOT_PWD);
		}
		return bean;
	}
}
